Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Elastic Agent] Fix deb/rpm installation #22153

Merged
merged 4 commits into from
Oct 27, 2020

Conversation

blakerouse
Copy link
Contributor

@blakerouse blakerouse commented Oct 26, 2020

What does this PR do?

Fixes the installation of Elastic Agent using the .deb and .rpm.

This fixes the issue of the Elastic Agent .deb not working on Ubuntu because the starting parameters of --environment systemd cannot be used on the root cmd, it can only be used on the run subcommand.

This fixes the issue of the Elastic Agent .rpm not working on Fedora because SELinux prevents a systemd unit from starting a binary inside of /usr/share. This switches the command of the unit to /usr/bin/elastic-agent which will already provide the wrapper command args for the paths and not prevent SELinux from starting the binary.

Why is it important?

Allows Elastic Agent to work from a .deb and .rpm installation.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files
  • [ ] I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Related issues

@blakerouse blakerouse added needs_backport PR is waiting to be backported to other branches. Team:Ingest Management labels Oct 26, 2020
@blakerouse blakerouse self-assigned this Oct 26, 2020
@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Oct 26, 2020
@botelastic
Copy link

botelastic bot commented Oct 26, 2020

This pull request doesn't have a Team:<team> label.

@blakerouse blakerouse marked this pull request as ready for review October 26, 2020 15:01
@elasticmachine
Copy link
Collaborator

Pinging @elastic/ingest-management (Team:Ingest Management)

@elasticmachine
Copy link
Collaborator

elasticmachine commented Oct 26, 2020

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #22153 updated]

  • Start Time: 2020-10-27T12:34:26.792+0000

  • Duration: 90 min 8 sec

Test stats 🧪

Test Results
Failed 0
Passed 16367
Skipped 1344
Total 17711

Copy link
Member

@ruflin ruflin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to have some more details in the PR description why this change fixes the current issue. I can see that run with systemd is used. Does this apply to all Linux distros?

@blakerouse
Copy link
Contributor Author

@ruflin Added more information to the PR description.

Copy link
Member

@ruflin ruflin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the details. This is helpful. So we basically fix 2 different issue in one go an even simplify the template!

Change LGTM but did not test it on any of the systems locally.

@ruflin
Copy link
Member

ruflin commented Oct 27, 2020

@blakerouse As we discussed on the Monday meeting, we should work with @EricDavisX to reenabled the deb/rpm test cases and make sure also this one here is covered.

Copy link
Contributor

@michalpristas michalpristas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change lgtm

@EricDavisX
Copy link
Contributor

for reference, the e2e feature work for the rpm/deb install is here: elastic/e2e-testing#379

@blakerouse blakerouse merged commit f07cc32 into elastic:master Oct 27, 2020
@blakerouse blakerouse deleted the agent-fix-deb-rpm branch October 27, 2020 14:04
@blakerouse blakerouse added v7.11.0 and removed needs_backport PR is waiting to be backported to other branches. labels Oct 27, 2020
blakerouse added a commit to blakerouse/beats that referenced this pull request Oct 27, 2020
* Fix issue on elastic-agent systemd unit.

* Fix service file for fedora.

* Add changelog.

(cherry picked from commit f07cc32)
blakerouse added a commit to blakerouse/beats that referenced this pull request Oct 27, 2020
* Fix issue on elastic-agent systemd unit.

* Fix service file for fedora.

* Add changelog.

(cherry picked from commit f07cc32)
blakerouse added a commit that referenced this pull request Oct 28, 2020
* Fix issue on elastic-agent systemd unit.

* Fix service file for fedora.

* Add changelog.

(cherry picked from commit f07cc32)
blakerouse added a commit that referenced this pull request Oct 28, 2020
* Fix issue on elastic-agent systemd unit.

* Fix service file for fedora.

* Add changelog.

(cherry picked from commit f07cc32)
v1v added a commit to v1v/beats that referenced this pull request Oct 29, 2020
* upstream/master: (93 commits)
  Update commands used in the quick start (elastic#22248)
  Add interval documentation to `monitor` metricset (elastic#22152)
  [CI] enable x-pack/packetbeat in the CI (elastic#22252)
  Fix awscloudwatch input documentation (elastic#22247)
  Add support for different Azure Cloud environments in the metricbeat azure module (elastic#21044)
  [CI] support windows-2008-r2 (elastic#19791)
  protect against accessing undefined variables in sysmon module (elastic#22236)
  [CI] archive only if failed steps (elastic#22220)
  Add pe fields to Sysmon module (elastic#22217)
  [CI][flaky] Support 7.x branches and PRs (elastic#22197)
  Perfmon - Fix regular expressions to comply to multiple parentheses in instance name and object (elastic#22146)
  ci: improve linting speed (elastic#22103)
  Move cloudfoundry tags with metadata to common metadata fields (elastic#22150)
  [Docs] Update custom beat docs (elastic#22194)
  [Ingest Manager] Agent fix snapshot download for upgrade (elastic#22175)
  Update shared-autodiscover.asciidoc (elastic#21827)
  [DOCS] Warn about compression and Azure Event Hub for Kafka (elastic#21578)
  [CI][flaky] reporting for PRs in GitHub (elastic#21853)
  [Packetbeat] Create x-pack magefile (elastic#21979)
  [Elastic Agent] Fix deb/rpm installation (elastic#22153)
  ...
v1v added a commit to v1v/beats that referenced this pull request Oct 29, 2020
* upstream/master: (93 commits)
  Update commands used in the quick start (elastic#22248)
  Add interval documentation to `monitor` metricset (elastic#22152)
  [CI] enable x-pack/packetbeat in the CI (elastic#22252)
  Fix awscloudwatch input documentation (elastic#22247)
  Add support for different Azure Cloud environments in the metricbeat azure module (elastic#21044)
  [CI] support windows-2008-r2 (elastic#19791)
  protect against accessing undefined variables in sysmon module (elastic#22236)
  [CI] archive only if failed steps (elastic#22220)
  Add pe fields to Sysmon module (elastic#22217)
  [CI][flaky] Support 7.x branches and PRs (elastic#22197)
  Perfmon - Fix regular expressions to comply to multiple parentheses in instance name and object (elastic#22146)
  ci: improve linting speed (elastic#22103)
  Move cloudfoundry tags with metadata to common metadata fields (elastic#22150)
  [Docs] Update custom beat docs (elastic#22194)
  [Ingest Manager] Agent fix snapshot download for upgrade (elastic#22175)
  Update shared-autodiscover.asciidoc (elastic#21827)
  [DOCS] Warn about compression and Azure Event Hub for Kafka (elastic#21578)
  [CI][flaky] reporting for PRs in GitHub (elastic#21853)
  [Packetbeat] Create x-pack magefile (elastic#21979)
  [Elastic Agent] Fix deb/rpm installation (elastic#22153)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Fleet] Elastic-Agent doesn't start up with .rpm / .deb usage (with enroll cmd)
5 participants